home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / usr / bin / artsdsp < prev    next >
Text File  |  2008-08-25  |  2KB  |  107 lines

  1. #!/bin/sh
  2. # artsdsp - wrapper script to allow *some* binary only programs to use artsd
  3. # based on the esddsp script
  4.  
  5. # keep this in sync with artsversion.h
  6. version="1.5.10"
  7.  
  8. # default values for script variables
  9. verbose=0
  10. set_name=0
  11. single_thread=0
  12.  
  13. # check for artsdsp options
  14. while test $# -gt 0; do
  15.  
  16.     case "$1" in
  17.  
  18.     -h|--help)
  19.         echo "artsdsp - attempt to reroute audio device to artsd"
  20.         echo " "
  21.         echo "artsdsp [options] application arguments"
  22.         echo " "
  23.         echo "options:"
  24.         echo "-h, --help                show brief help"
  25.         echo "-n, --name=NAME           use name to identify player to artsd"
  26.         echo "-m, --mmap                emulate memory mapping (i.e. for quake)"
  27.         echo "-s, --single-threaded     use the single-threaded version"
  28.         echo "-v, --verbose             show parameters"
  29.         echo "-V, --version             show version"
  30.         exit 0
  31.         ;;
  32.  
  33.     -n)
  34.         shift
  35.         if test $# -gt 0; then
  36.         export ARTSDSP_NAME=$1
  37.         else
  38.         echo "no player name specified"
  39.         exit 1
  40.         fi
  41.         shift
  42.         set_name=1
  43.         ;;
  44.  
  45.     --name*)
  46.         export ARTSDSP_NAME=`echo $1 | sed -e 's/^[^=]*=//g'`
  47.         set_name=1
  48.         shift
  49.         ;;
  50.  
  51.     -v|--verbose)
  52.         verbose=1
  53.         shift
  54.         ;;
  55.  
  56.     -V|--version)
  57.         echo "artsdsp $version"
  58.         exit
  59.         ;;
  60.  
  61.     -m|--mmap)
  62.         export ARTSDSP_MMAP=1
  63.         shift
  64.         ;;
  65.  
  66.     -s|--single-threaded)
  67.         single_thread=1
  68.         shift
  69.         ;;
  70.  
  71.     *)
  72.         # no more artsdsp options, get on with life
  73.         break
  74.         ;;
  75.     esac
  76. done
  77.  
  78. # echo options if verbose specified
  79. if test "$verbose" = 1; then
  80.     ARTSDSP_VERBOSE=1
  81.     export ARTSDSP_VERBOSE
  82.     echo "artsdsp:       $version"
  83.     echo "name:          $ARTSDSP_NAME"
  84.     echo "command line:  $@"
  85.     if test "$single_thread" = 1; then
  86.         echo "threaded:      no"
  87.     else
  88.         echo "threaded:      yes"
  89.     fi
  90. fi
  91.  
  92. prefix=/usr
  93. exec_prefix=${prefix}
  94.  
  95. if test "$single_thread" = 1; then
  96.   LD_PRELOAD=${exec_prefix}/\$LIB/libartsdsp_st.so.0
  97. else
  98.   LD_PRELOAD=${exec_prefix}/\$LIB/libartsdsp.so.0:${exec_prefix}/\$LIB/libartsc.so.0
  99. fi
  100. if test -f ${exec_prefix}/\$LIB/libdl.so.2; then
  101.   LD_PRELOAD=$LD_PRELOAD:${exec_prefix}/\$LIB/libdl.so.2
  102. fi
  103. export LD_PRELOAD
  104.  
  105. # invoke the program with the args given
  106. exec "$@"
  107.